home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / larn.lha / larndefs.h < prev    next >
C/C++ Source or Header  |  1995-11-19  |  5KB  |  136 lines

  1. /*
  2.   Function, data declarations
  3. */
  4. extern char regen_bottom;
  5. extern char floorc, wallc;
  6. extern char boldobjects;
  7. extern char auto_pickup;
  8. extern char VERSION,SUBVERSION;
  9. extern char aborted[],beenhere[],boldon,cheat,ckpfile[],ckpflag;
  10. extern char *class[],course[],diagfile[],fortfile[],helpfile[],holifile[];
  11. extern char ckpfile[];
  12. # ifdef MSDOS
  13. extern int  swapfd;
  14. extern char swapfile[];
  15. extern long tell(), lseek();
  16. # endif
  17. extern char *inbuffer;
  18. extern char item[MAXX][MAXY],iven[],know[MAXX][MAXY],larnlevels[],lastmonst[];
  19. extern char level,*levelname[],logfile[],loginname[],logname[],*lpbuf,*lpend;
  20. extern char *lpnt,mitem[MAXX][MAXY],monstlevel[];
  21. extern char monstnamelist[],nch[],ndgg[],nlpts[],nomove,nosignal,nowelcome;
  22. extern char nplt[],nsw[],*objectname[];
  23. extern char hacklike_objnamelist[];
  24. extern char original_objnamelist[];
  25. extern char objnamelist[],optsfile[],*potionname[],playerids[],potprob[];
  26. extern char predostuff,psname[],restorflag,savefilename[],scorefile[],scprob[];
  27. extern char screen[MAXX][MAXY],*scrollname[],sex,*spelcode[],*speldescript[];
  28. extern char spelknow[],*spelname[],*spelmes[];
  29. extern char splev[],stealth[MAXX][MAXY],wizard;
  30. extern short diroffx[],diroffy[],hitflag,hit2flag,hit3flag,hitp[MAXX][MAXY];
  31. extern short iarg[MAXX][MAXY],ivenarg[],lasthx,lasthy,lastnum,lastpx,lastpy;
  32. extern short nobeep,oldx,oldy,playerx,playery;
  33. extern int dayplay,enable_scroll,yrepcount,userid,wisid,lfd,fd;
  34. extern long initialtime,outstanding_taxes,skill[],gtime,c[],cbak[];
  35. extern unsigned long lrandx;
  36. # ifndef MSDOS      /* Different storage under MSDOS */
  37. extern struct cel *cell;
  38. # endif
  39. extern struct sphere *spheres;
  40.  
  41. void *malloc();
  42. char *fortune(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime();
  43. char *tmcapcnv(),*tgetstr(),*tgoto();
  44. long paytaxes(),lgetc(),lrint(),time();
  45. unsigned long readnum();
  46.  
  47.     /* macro to create scroll #'s with probability of occurrence */
  48. #define newscroll() (scprob[rund(81)])
  49.     /* macro to return a potion # created with probability of occurrence */
  50. #define newpotion() (potprob[rund(41)])
  51.     /* macro to return the + points on created leather armor */
  52. #define newleather() (nlpts[rund(c[HARDGAME]?13:15)])
  53.     /* macro to return the + points on chain armor */
  54. #define newchain() (nch[rund(10)])
  55.     /* macro to return + points on plate armor */
  56. #define newplate() (nplt[rund(c[HARDGAME]?4:12)])
  57.     /* macro to return + points on new daggers */
  58. #define newdagger() (ndgg[rund(13)])
  59.     /* macro to return + points on new swords */
  60. #define newsword() (nsw[rund(c[HARDGAME]?6:13)])
  61.     /* macro to destroy object at present location */
  62. #define forget() (item[playerx][playery]=know[playerx][playery]=0)
  63.     /* macro to wipe out a monster at a location */
  64. #define disappear(x,y) (mitem[x][y]=know[x][y]=0)
  65.  
  66. #ifdef VT100
  67.     /* macro to turn on bold display for the terminal */
  68. #define setbold() (lprcat(boldon?"\33[1m":"\33[7m"))
  69.     /* macro to turn off bold display for the terminal */
  70. #define resetbold() (lprcat("\33[m"))
  71.     /* macro to setup the scrolling region for the terminal */
  72. #define setscroll() (lprcat("\33[20;24r"))
  73.     /* macro to clear the scrolling region for the terminal */
  74. #define resetscroll() (lprcat("\33[;24r"))
  75.     /* macro to clear the screen and home the cursor */
  76. #define clear() (lprcat("\33[2J\33[f"), regen_bottom=TRUE)
  77. #define cltoeoln() lprcat("\33[K")
  78. #else /* VT100 */
  79.     /* defines below are for use in the termcap mode only */
  80. #define ST_START 1
  81. #define ST_END   2
  82. #define BOLD     3
  83. #define END_BOLD 4
  84. #define CLEAR    5
  85. #define CL_LINE  6
  86. #define T_INIT   7
  87. #define T_END    8
  88. #define CL_DOWN 14
  89. #define CURSOR  15
  90.     /* macro to turn on bold display for the terminal */
  91. #define setbold() (*lpnt++ = ST_START)
  92.     /* macro to turn off bold display for the terminal */
  93. #define resetbold() (*lpnt++ = ST_END)
  94.     /* macro to setup the scrolling region for the terminal */
  95. #define setscroll() enable_scroll=1
  96.     /* macro to clear the scrolling region for the terminal */
  97. #define resetscroll() enable_scroll=0
  98.     /* macro to clear the screen and home the cursor */
  99. #define clear() (*lpnt++ =CLEAR, regen_bottom=TRUE)
  100.     /* macro to clear to end of line */
  101. #define cltoeoln() (*lpnt++ = CL_LINE)
  102. #endif /* VT100 */
  103.  
  104.     /* macro to output one byte to the output buffer */
  105. #define lprc(ch) ((lpnt>=lpend)?(*lpnt++ =(ch), lflush()):(*lpnt++ =(ch)))
  106.  
  107.     /* macro to seed the random number generator */
  108. #define srand(x) (lrandx=x)
  109. #ifdef MACRORND
  110.     /* macros to generate random numbers   1<=rnd(N)<=N   0<=rund(N)<=N-1 */
  111. #define rnd(x)  ((((lrandx=lrandx*1103515245+12345)>>7)%(x))+1)
  112. #define rund(x) ((((lrandx=lrandx*1103515245+12345)>>7)%(x))  )
  113. #endif /* MACRORND */
  114.  
  115. #define KNOWNOT   0x00
  116. #define HAVESEEN  0x1
  117. #define KNOWHERE  0x2
  118. #define KNOWALL   (HAVESEEN | KNOWHERE)
  119. #ifdef MSDOS
  120. # ifdef OS2LARN
  121. #  define PATHLEN   256
  122. #  define DIRLEN    256
  123. #  define INCL_BASE
  124. #  include <os2.h>
  125. #  define sleep(x)    DosSleep(x*1000L);
  126. # else
  127. #  define PATHLEN   80
  128. #  define DIRLEN    64
  129. # endif
  130.   extern   char    larndir[];
  131.   extern int       raw_io, DECRainbow, keypad, ramlevels, cursorset;
  132.   extern unsigned char cursorstart, cursorend;
  133. #endif MSDOS
  134.  
  135. extern char prompt_mode ;
  136.